//api文件仍保留但不建议使用，推荐使用models中的api。API files remain preserved (deprecated), use models APIs instead.
import type { Attachments, AttachmentsResponse } from './types.js';

import { requestClient } from '#/api/request';

export const getuctooAttachmentsList = async (page: number, pageSize: number,
  searchParams?: any) => {
  return requestClient.get<AttachmentsResponse>(`/uctoo/attachments/${pageSize}/${page}`,{
    params: searchParams,
  });
};

export const getuctooAttachments = async (id: string) => {
  return requestClient.get<Attachments>(`/uctoo/attachments/${id}`);
};

export const adductooAttachments = async (data: Partial<Attachments>) => {
  return requestClient.post<Attachments>('/uctoo/attachments/add', data);
};

export const edituctooAttachments = async (data: Partial<Attachments>) => {
  return requestClient.post<Attachments>('/uctoo/attachments/edit', data);
};

export const deleteuctooAttachments = async (id: string) => {
  return requestClient.post<any>('/uctoo/attachments/del', { id });
};
